<div class="page-content">
    <div class="col-sm-6 pull-right">
        <button class="btn btn-sm btn-primary pull-right" onclick="javascript:window.location.href = 'index'">
            返回列表
            <i class="icon-reply icon-only"></i>
        </button>
    </div>
    <div class="page-header">
        <h1>
            {:model('menu')->getParentNname()}
            <small>
                <i class="ace-icon fa fa-angle-double-right"></i>
                {:input('id')?'编辑':'新增'}
                只有服务号，可以回复多条内容，订阅号，只能回复一条 关键词留空为关注回复
            </small>
        </h1>
    </div><!-- /.page-header -->

    <div class="row" style="height: auto">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" role="form" action="{:input('id')?'imageinfo':'imageinfoadd'}" method="post" enctype="multipart/form-data" name="myfrom" >
                {:input('id')?'<input type="hidden" value="'.$info['reply_set_id'].'" name="id">':''}
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">关键词:</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-xs-10 col-sm-5" value="{$info.reply_keywords|default=''}" name="reply_keywords"/>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 公众号名称: </label>

                    <div class="col-sm-9">
                        <select name="app_id">
                            {volist name="app_names" id="vo"}
                            <option value="{$vo.app_id}"
                                    {if condition="$vo.app_id == $info.app_id"}
                                    selected="selected"
                                    {/if}
                            >{$vo.appname}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group ">
                    <div class="col-sm-3"></div>
                        <label>
                            <input type="radio" name="reply_type" id="xz1" value="1" checked>
                            图文
                        </label>


                        <label>
                            <input type="radio" name="reply_type" id="xz2" value="0">
                            文本
                        </label>
                    </div>

                <div class="zj">
                <div class="form-inline">
                <div class="form-group col-sm-2" >
                    <label class="no-padding-right">标题:</label>
                        <input type="text" size="10px" class="form-control" value="{$info.title|default=''}" name="title[]"/>
                </div>
                <div class="form-group col-sm-3">
                        <input type="file"  style="width: 80%;" class="form-control" name="image_url[]" id="thisfile" value="{$info.image_url|default=''}">
                            <!-- 用于展示上传文件名的表单 -->
                    <!--  <input id="showname" class="form-control"  value="{$info.image_url|default=''}"  type="text" style="height: 32px;width: 150px;">-->
                            <!-- 点击触发按钮 -->
                       <!--  <a class="btn btn-primary" style="height: 32px" onclick="makeThisfile(this)" id="browse">浏览图片</a>-->

                </div>
                <div class="form-group col-sm-3" >
                    <label class="no-padding-right">跳转url</label>
                        <input type="text" class="form-control" value="{$info.url|default=''}" name="url[]"/>
                </div>
                <div class="col-sm-4 form-group">
                    <div class="col-sm-9 form-group" style="border: 0px solid red">
                    <label class="no-padding-right">描述: </label>
                        <textarea class="form-control" cols="22" rows="1"  name="description[]" >{$info.description|default=''}</textarea>
                    </div>
                    <div class="col-sm-3" style="height: 32px;line-height: 32px">
                        <span class="zjyt"> <a href="javascript:;" onclick="zj(this);">+</a></span><span class="jqyt"> <a href="javascript:;" onclick="del(this);">-</a></span>
                    </div>

                </div>

                </div>
                </div>
                <div class="wbk" style="display: none">
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right"> 回复内容: </label>

                        <div class="col-sm-9">
                            <div class="fhnr" style="float: left">
                            <textarea  name="reply_answer[]" rows="5" cols="50" >{$info.reply_answer|default=''}</textarea>
                            </div>
                            <div class="hfjz" style="float: left;height: 110px;line-height: 110px;border: 0px solid red">
                            <span class="zjyt"> <a href="javascript:;" onclick="zj_wb(this);">+</a></span><span class="jqyt"> <a href="javascript:;" onclick="del(this);">-</a></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="zjs" style="overflow: hidden"></div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="button" onclick="myfrom.submit()">
                            <i class="ace-icon fa fa-check bigger-110"></i>
                            提交
                        </button>
                        &nbsp; &nbsp; &nbsp;
                        <button class="btn" type="reset">
                            <i class="ace-icon fa fa-undo bigger-110"></i>
                            重置
                        </button>
                    </div>
                </div>
            </form>
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.col -->
    </div><!-- /.row -->
</div><!-- /.page-content -->

<script type="text/javascript">
    $(function () {
        $(".dr").click(function () {
            var str = $("#thisfile").val();
            if (str == '') {
                alert('要导入的东西不能为空');
                return false;
            }
        })

        $("#xz1").click(function () {
            $(".zj").show();
            $(".wbk").hide();
        })
        $("#xz2").click(function () {

            $(".zj").hide();
            $(".wbk").show();
        })
    })
function zj() {
         var strhtml = $(".zj").html();
         $(".zjs").append(strhtml);
}
    function zj_wb() {
        var strhtml = $(".wbk").html();
        $(".zjs").append(strhtml);
    }
function del(obj) {
    var str = obj.parentNode.parentNode.parentNode.parentNode;
    str.parentNode.removeChild(str);
}
    function makeThisfile(which) {
        $(which).prev().prev().click(function () {
            $(which).prev().val( $(which).prev().prev().val());
        });

       // objs.prev("#showname").click();
       // $('#thisfile').click();
    }

    //file表单选中文件时,让file表单的val展示到showname这个展示框
   // $('#thisfile').change(function () {
   //     $('#showname').val($(this).val())
 //   })

</script>
<style type="text/css">
    #browse {
        border: 1px solid #ccc;
        border-radius: 4px;
        background-color: #2c9a8a;
        color: #fff;
    }
    .zj{border:0px solid red;overflow: hidden}
    .zjyt a{font-size: 35px;color: #00BE67;cursor: pointer}
    .jqyt a{font-size: 35px;color:red;padding-left: 3px;cursor: pointer}
    .form-inline{overflow: hidden;margin-bottom: 5px;margin-left: 30px}
</style>